# !/usr/bin/env python
# -*- coding:utf-8 -*-
# @Time      :2022/8/8 0008 21:08
# @Author    :jiaxuesong

import time
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from common.log import logger


#定义显示等待类
class BasePage(object):
    #定义初始化方法，获取driver
    def __init__(self, driver):
        self.driver = driver


    # 定义显示等待对外调用方法
    def by_find_element(self, *item):
        try:
            element = WebDriverWait(self.driver, 20).until(EC.presence_of_element_located(item))
            return element
        except Exception as msg:
            logger.error(f'元素{item}定位失败！')







